// 第一步
const mongoose = require("mongoose");
mongoose.pluralize(null); //去掉集合后面的s
const { Schema, model } = mongoose;
const versionKey = { versionKey: false };
const moment = require("moment");
moment.locale("zh-cn");

// 点赞表
const LikeSchema = new Schema({
    user_uid:String,//点赞用户uid
    author_uid:String,//游记作者uid
    user_id:{
      // 关联用户表
      type:mongoose.Schema.Types.ObjectId,
      ref:'user',
      required:true
    },
    article_id:{
      // 关联游记表
      type:mongoose.Schema.Types.ObjectId,
      ref:'usertravel',
      required:true
    },
  },versionKey);

  
  // 第三步
module.exports = {
    modelLike: model("like", LikeSchema)
  };
  